package Store;
import java.util.SortedMap;

import EurekaAnalyzer.IDInformation;

import com.sleepycat.bind.EntryBinding;
import com.sleepycat.bind.serial.ClassCatalog;
import com.sleepycat.bind.serial.SerialBinding;
import com.sleepycat.collections.StoredEntrySet;
import com.sleepycat.collections.StoredMap;

/**
 * 
 * @author Xenophon
 * @version 2009-12-5
 *
 */
public class StoreView {
	private StoredMap idInfoMap;
	
	public StoreView(StoreDB db)
	{
		ClassCatalog cc = db.GetClassLog();
		EntryBinding keyBinding = new SerialBinding(cc, IDInfoKey.class);
		EntryBinding valueBinding = new SerialBinding(cc, IDInformation.class);
		idInfoMap = new StoredMap(db.GetIDDatabase(), keyBinding, valueBinding, true);
	}
	
	public final StoredMap GetIDInfoMap()
	{
		return idInfoMap;
	}
	
	public final StoredEntrySet GetIDEntrySet()
	{
		return (StoredEntrySet) idInfoMap.entrySet();
	}
}
